﻿package com.tudou.home.utils
{
    import com.tudou.newPlayer.*;
    import com.tudou.track.*;

    public class HomeTrack extends Object
    {
        protected var playerStatus:IPlayerStatus;
        private static var _ins:HomeTrack = null;

        public function HomeTrack()
        {
            return;
        }// end function

        public function init(param1:IPlayerStatus) : void
        {
            this.playerStatus = param1;
            return;
        }// end function

        public function addButtonLog(param1:String, param2:String) : void
        {
            var _loc_5:Array = null;
            var _loc_6:Number = NaN;
            var _loc_3:* = param2;
            var _loc_4:* = new RegExp("^" + SkinButtonCode.PROGRESS + "\\|", "i");
            if (param2.search(_loc_4) !== -1)
            {
                _loc_5 = _loc_3.split("|");
                _loc_6 = Number(_loc_5.pop());
                _loc_5.push(playerStatus.videoStatus.status);
                _loc_5.push(_loc_6 * playerStatus.totalTime);
                _loc_3 = _loc_5.join("|");
            }
            AOPTracker.getInst().addNodeLog(NodeLog.BUTTON_CLICK, [_loc_3]);
            return;
        }// end function

        public static function get ins() : HomeTrack
        {
            if (_ins == null)
            {
                _ins = new HomeTrack;
            }
            return _ins;
        }// end function

    }
}
